import request from '@/utils/request'

const api_name = '/hr/service/unit'

export default {
  get_units() {
    return request({
      url: `${api_name}/units`,
      method: 'get'
    })
  },
  get_unit(id) {
    return request({
      url: `${api_name}/unit`,
      method: 'get',
      params: { id }
    })
  },
  add_unit(unit) {
    return request({
      url: `${api_name}/unit`,
      method: 'post',
      data: unit
    })
  },
  update_unit(unit) {
    return request({
      url: `${api_name}/unit`,
      method: 'put',
      data: unit
    })
  },
  delete_unit(id) {
    return request({
      url: `${api_name}/unit/${id}`,
      method: 'delete'
    })
  }

}
